SET(TARGET_NAME BulletLib)

#必须要有的宏定义

ADD_DEFINITIONS (-DBulletLibrary_EXPORT)
#ADD_DEFINITIONS (-DBOOST_ALL_NO_LIB)
#ADD_DEFINITIONS (-DBOOST_PROGRAM_OPTIONS_DYN_LINK)
#ADD_DEFINITIONS (-DBOOST_TEST_DYN_LINK)


IF (CMAKE_CL_64)


ELSE()
ENDIF()
	INCLUDE_DIRECTORIES( ${OSG_DIR}/include )
	LINK_DIRECTORIES( ${OSG_DIR}/lib )


	
	INCLUDE_DIRECTORIES( ${OSG_WORKS_DIR}/include )
	LINK_DIRECTORIES( ${OSG_WORKS_DIR}/lib )
	
	INCLUDE_DIRECTORIES( ${LUA_DIR}/include)
	LINK_DIRECTORIES(${LUA_DIR}/lib)
	
	#INCLUDE_DIRECTORIES( ${LIBXL_DIR}/include)
	#LINK_DIRECTORIES( ${LIBXL_DIR}/lib)
	
	INCLUDE_DIRECTORIES( ${BULLET_DIR}/include)
	LINK_DIRECTORIES( ${BULLET_DIR}/lib)
	
	INCLUDE_DIRECTORIES( ${OSG_BULLET_DIR}/include )
	LINK_DIRECTORIES( ${OSG_BULLET_DIR}/lib )
	

	#INCLUDE_DIRECTORIES( ${OMPL_DIR}/include)
	#LINK_DIRECTORIES( ${OMPL_DIR}/lib )
        #INCLUDE_DIRECTORIES( ${BOOST_DIR}/include)
        #LINK_DIRECTORIES( ${BOOST_DIR}/lib)

        INCLUDE_DIRECTORIES( ${QHULL}/include)
        LINK_DIRECTORIES( ${QHULL}/lib)

        INCLUDE_DIRECTORIES( ${OPENGL})
        LINK_DIRECTORIES( ${OPENGL}/lib)

        INCLUDE_DIRECTORIES( ${CG}/include)
        LINK_DIRECTORIES( ${CG}/lib)

        INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/${TARGET_NAME}/include)
        LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/build/lib)

        INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/OsgLib/include)
        INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/OpenTissueLib/include)

        INCLUDE_DIRECTORIES(${OPEN_TISSUE})
        LINK_DIRECTORIES(${OPEN_TISSUE}/lib)

        INCLUDE_DIRECTORIES(${QT_DIR}/include)
        INCLUDE_DIRECTORIES(${QT_DIR}/include/QtCore)
        INCLUDE_DIRECTORIES(${QT_DIR}/include/QtNetwork)
        INCLUDE_DIRECTORIES(${QT_DIR}/include/QtGui)

        LINK_DIRECTORIES(${QT_DIR}/lib)

        INCLUDE_DIRECTORIES( ${QUA_ZIP}/include)
        LINK_DIRECTORIES( ${QUA_ZIP}/lib)

        INCLUDE_DIRECTORIES( ${ZLIB}/include)
        LINK_DIRECTORIES( ${ZLIB}/lib)

        INCLUDE_DIRECTORIES( ${Cppipm}/include)
        LINK_DIRECTORIES( ${Cppipm}/lib)

#库文件在debug下名字后面加d
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")
SET(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")


FILE(GLOB_RECURSE ThisTarget_INCLUDE_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/include/*.h")
FILE(GLOB_RECURSE ThisTarget_SRC_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/src/*.cpp")
source_group("include" FILES ${ThisTarget_INCLUDE_LIST})
source_group("src" FILES ${ThisTarget_SRC_LIST})

ADD_LIBRARY(${TARGET_NAME} SHARED ${ThisTarget_SRC_LIST} ${ThisTarget_INCLUDE_LIST})

SET(ADDITIONAL_LIBRARIES_RELEASE 
				#ompl.lib
				#boost_filesystem-vc100-mt-1_48.lib
				#boost_system-vc100-mt-1_48.lib
				#boost_thread-vc100-mt-gd-1_48.lib
				#boost_date_time-vc100-mt-1_48.lib
				#boost_program_options-vc100-mt-1_48.lib
				#boost_serialization-vc100-mt-1_48.lib

				
				osg.lib
				osgViewer.lib
				osgDB.lib						
				osgGA.lib
				osgText.lib
				osgUtil.lib
				osgShadow.lib
				osgSim.lib
				osgManipulator.lib
				OpenThreads.lib
				
				osgwTools.lib
				
				lua.lib
				
                                OsgLib.lib

				BulletCollision.lib
				BulletDynamics.lib
				HACD.lib
				LinearMath.lib
				osgbCollision.lib
				osgbDynamics.lib
				osgbInteraction.lib
				osgwTools.lib
				#SwigOsgToLua.lib
                                #OpenTissueLib.lib
                                QtXml4.lib
                                QtCore4.lib
                                QtGui4.lib
                                quazip.lib
                                QtNetwork4.lib
                                Cppipm.lib
				)   

SET(ADDITIONAL_LIBRARIES_DEBUG 
				#ompld.lib
				#boost_filesystem-vc100-mt-gd-1_48.lib
				#boost_system-vc100-mt-gd-1_48.lib
				#boost_thread-vc100-mt-gd-1_48.lib
				#boost_date_time-vc100-mt-gd-1_48.lib
				#boost_program_options-vc100-mt-gd-1_48.lib
				#boost_serialization-vc100-mt-gd-1_48.lib

				
				osgd.lib
				osgViewerd.lib
				osgDBd.lib						
				osgGAd.lib
				osgTextd.lib
				osgUtild.lib
				osgShadowd.lib
				osgSimd.lib
				osgManipulatord.lib
				OpenThreadsd.lib

				osgwToolsd.lib
				
				luad.lib
				
                                OsgLibd.lib

				BulletCollision_debug.lib
				BulletDynamics_debug.lib
                                #HACD_debug.lib
				LinearMath_debug.lib
				osgbCollisiond.lib
				osgbDynamicsd.lib
				osgbInteractiond.lib
				osgwToolsd.lib
				#SwigOsgToLuad.lib
                                #OpenTissueLibd.lib
                                QtXmld4.lib
                                QtCored4.lib
                                QtGuid4.lib
                                quazipd.lib
                                QtNetworkd4.lib
                                Cppipmd.lib
				)
TARGET_LINK_LIBRARIES(${TARGET_NAME} debug "${ADDITIONAL_LIBRARIES_DEBUG}" optimized "${ADDITIONAL_LIBRARIES_RELEASE}")

set_target_properties(${TARGET_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/lib)
set_target_properties(${TARGET_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/lib)
set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/bin)
set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/bin)









